﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ERPStore.Extensions;

namespace ERPStore.Logging
{
	public class ServiceBusLogger : Ariane.ILogger
	{
		ERPStore.Logging.ILogger m_Logger;
		protected ERPStore.Logging.ILogger InnerLogger
		{
			get
			{
				if (m_Logger== null)
				{
					m_Logger = ERPStore.GlobalConfiguration.Configuration.DependencyResolver.GetService<ERPStore.Logging.ILogger>();
				}
				return m_Logger;
			}
		}

		#region ILogger Members

		public void Debug(string message, params object[] prms)
		{
			InnerLogger.Debug(message, prms);
		}

		public void Debug(string message)
		{
			InnerLogger.Debug(message);
		}

		public void Error(Exception x)
		{
			InnerLogger.Error(x);
		}

		public void Error(string message, params object[] prms)
		{
			InnerLogger.Error(message, prms);
		}

		public void Error(string message)
		{
			InnerLogger.Error(message);
		}

		public void Fatal(Exception x)
		{
			InnerLogger.Fatal(x);
		}

		public void Fatal(string message, params object[] prms)
		{
			InnerLogger.Fatal(message, prms);
		}

		public void Fatal(string message)
		{
			InnerLogger.Fatal(message);
		}

		public void Info(string message, params object[] prms)
		{
			InnerLogger.Info(message, prms);
		}

		public void Info(string message)
		{
			InnerLogger.Info(message);
		}

		public void Notification(string message, params object[] prms)
		{
			InnerLogger.Notification(message, prms);
		}

		public void Notification(string message)
		{
			InnerLogger.Notification(message);
		}

		public void Warn(string message, params object[] prms)
		{
			InnerLogger.Warn(message, prms);
		}

		public void Warn(string message)
		{
			InnerLogger.Warn(message);
		}

		#endregion
	}
}
